const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    entry: './src/index',
    output: {
        filename: 'js/[name].js',
        path: resolve(__dirname, 'build'),
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                //排除node_modules下文件
                exclude: /node_modules/,
                //只检查src下的js文件
                include: resolve(__dirname, 'src'),
                //优先执行
                enforce: 'pre',
                //延后执行
                // enforce: 'post',
                //单个loader用loader
                loader: 'eslint-loader',
                options: {},
            },
        ],
    },
    plugins: [new HtmlWebpackPlugin()],
};
